import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:hc_bot_pro/chat/state.dart';
import 'package:hc_bot_pro/chat/widgets/chet_list_view.dart';
import 'package:hc_bot_pro/chat/widgets/siri/siri_view.dart';
import 'package:hc_bot_pro/common/ui/qr.dart';

import '../common/routes.dart';
import 'index.dart';
import 'widgets/cell.dart';

class ChatPage extends GetView<ChatController> {
  const ChatPage({super.key});

  // 主视图
  Widget _buildView() {
    return Row(
      children: [
        Expanded(child: ChatListView().paddingOnly(bottom: 20.h)),
        Container(child: SiriView(), width: 320.w),
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<ChatController>(
      init: ChatController(),
      id: "chat",
      builder: (vc) {
        return Container(
          padding: EdgeInsets.only(left: 22.w, right: 22.w, top: 0.h),
          decoration: BoxDecoration(
            image: DecorationImage(
              fit: BoxFit.cover,
              image: const AssetImage("assets/images/bg_main.png"),
            ),
          ),
          child: Scaffold(
            backgroundColor: Colors.transparent,
            body: SafeArea(child: _buildView()),
          ),
        );
      },
    );
  }
}
